/*
** Copyright (C) 2010 Calin Radoni
**
** This file is part of CHScanner.
**
** CHScanner is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** CHScanner is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with CHScanner. If not, see <http://www.gnu.org/licenses/>.
*/

#pragma once

#include <afxstr.h>
#include <atlimage.h>

#include "RgnWindow.h"

enum MSkinBackImgMode
{
	__msbimCenter = 0,		///< Display the image center
	__msbimTile = 1,		///< Tile the background image
	__msbimStretch = 2		///< Stretch the background image
};

/// This class holds the skin informations for CRgnDialog derived objects
class MSkin
{
private:
	CStdioFile theFile;

	CString thePath;

	COLORREF ColorFromString(CString);
	int      IntFromString(CString);
	bool     LoadTheImage(CImage*, CString);
	bool     PosFromString(RgnPoint*, CString);
	bool ProcessLine(char*);

public:
	MSkin(void);
	~MSkin(void);

	COLORREF         backColor;				///< color of main windows's background
	CImage           backImage;				///< an image to be put on main window
	MSkinBackImgMode backImageMode;			///< how the image should be displayed

	// the settings for the "move" button
	CImage   moveImage;
	RgnPoint moveImgPos;

	// the settings for the "size" button
	CImage   sizeImage;
	RgnPoint sizeImgPos;

	// child window background settings
	COLORREF cwBackColor;					///< color to be applied on child (not main) windows
	int      cwTransparency;				///< associated transparency level

	// child window title setting
	COLORREF titleColor;
	CString  titleFontName;
	int      titleFontSize;
	RgnPoint titlePos;

	// child window text settings
	COLORREF textColor;
	CString  textFontName;
	int      textFontSize;

	// child window region definition
	RgnWindow rgnWindow;					///< region definition

	void Initialize(void);
	bool LoadFromFile(CString, CString);

	bool InitializeToClientOnly(int);
};
